<template>
	<!-- 选择组题科目 -->
	<view v-if="visible" class="subject-popup">
		<view class="popup-shadow" @tap="closeModal"></view>
		<view class="popup-content">
			<view class="title">请先选择组题科目</view>
			<view class="list">
				<view @click="itemClick(index)" class="item" :class="{'on': keMenIndex==index}" v-for="(item,index) in keMen" :key="index">{{item}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"subjectPopup",
		props: {
			
		},
		watch: {
			
		},
		data() {
			return {
				visible: false,
				keMen: [],
				keMenIndex: 0,
			};
		},
		created(){
		},
		mounted(){
			let keName=this.$store.getters.getKeMuName;
			if(keName.indexOf('主管护师')!==-1 || keName.indexOf('初级护师')!==-1){
				this.keMen=['全部科目', '基础知识', '相关专业知识', '专业知识', '专业实践能力'];
			}else if(keName.indexOf('护士资格')!==-1){
				this.keMen=['全部科目', '专业实务', '实践能力'];
			}else{
				this.keMen=['全部科目'];
			}
			this.$emit('setKeName',this.keMen);
			console.log(this.$store.getters.getKeMuName,'---35')
		},
		methods: {
			itemClick(index){
				this.keMenIndex=index;
				this.$emit('menSelect',this.keMen[index]);
				this.closeModal();
			},
			openModal() {
			    this.visible = true;
			},
			closeModal() {
			    this.visible = false;
			}
		},
		beforeDestroy(){
			
		}
	}
</script>

<style lang="scss" scoped>
	.subject-popup{
		position: fixed;
		z-index: 111;
	}
	.subject-popup,.popup-shadow{
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
	}
	.popup-shadow,.popup-content{
		position: absolute;
	}
	.popup-content{
		top: 246rpx;
		right: 46rpx;
		width: 384rpx;
		overflow: hidden;
		padding: 30rpx 43rpx 46rpx;
		border-radius: 10rpx;
		background-color: rgba(0, 0, 0, 0.4); /* 黑色半透明 */
		backdrop-filter: blur(4px); /* 背景模糊 4px */
		.title{
			margin-bottom: 24rpx;
			text-align: center;
			font-size: 36rpx;
			color: #fff;
		}
		.item{
			display: flex;
			justify-content: center;
			align-items: center;
			height: 88rpx;
			margin-bottom: 16rpx;
			font-size: 28rpx;
			color: #1E1E1E;
			border: 2rpx solid #EAEAEA;
			border-radius: 12rpx;
			background-color: #fff;
			&:last-child{
				margin-bottom: 0;
			}
		}
	}
</style>